<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>小红帽科技|草帽聚合支付 - 后台管理 - 交易列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__ADMIN__/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__ADMIN__/style/admin.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <!--头部-->
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">交易单号</label>
                    <div class="layui-input-block">
                        <input type="text" name="trade_no" placeholder="请输入交易单号" value="{$Request.get.trade_no}" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">商户号</label>
                    <div class="layui-input-block">
                        <input type="text" name="uid" placeholder="请输入商户号" value="{$Request.get.uid}" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">开始时间</label>
                    <div class="layui-input-block">
                        <input type="text" name="start" class="layui-input app-laydate-item" placeholder="yyyy-MM-dd">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">结束时间</label>
                    <div class="layui-input-block">
                        <input type="text" name="end" class="layui-input app-laydate-item" placeholder="yyyy-MM-dd">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">交易渠道</label>
                    <div class="layui-input-block">
                        <select name="channel" lay-filter="channel">
                            <option value="">请选择一个支付渠道</option>
                            {volist name="code" id="vo"}
                            <option {$Request.get.channel == $vo.code ? 'selected' : '' } value="{$vo.code}">{$vo.name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">订单状态</label>
                    <div class="layui-input-block">
                        <select name="status" lay-filter="status">
                            <option value="">请选择一个状态</option>
                            <option {$Request.get.status == '0' ? 'selected' : '' } value="0">关闭订单</option>
                            <option {$Request.get.status == '1' ? 'selected' : '' } value="1">等待支付</option>
                            <option {$Request.get.status == '2' ? 'selected' : '' } value="2">支付成功</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-order" lay-submit lay-filter="app-order-list-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                        搜素
                    </button>
                    <button class="layui-btn  layui-bg-red layuiadmin-btn-order"  data-type="all" data-events="export">
                        <i class="layui-icon layui-icon-chart-screen layuiadmin-button-btn"></i>
                        导出
                    </button>
                </div>
            </div>
        </div>
        <!--数据表-->
        <div class="layui-card-body">
            <div class="app-channel-btns" style="margin-bottom: 10px;">
                <blockquote class="layui-elem-quote layui-quote-nm">
                    交易总流水：<span class="layui-badge layui-bg-green">{$fees.total}</span> 元
                    成交总金额：<span class="layui-badge layui-bg-black">{$fees.paid}</span> 元
                    商户收入总金额：<span class="layui-badge layui-bg-gray">{$fees.user}</span> 元
                    代理收入总金额：<span class="layui-badge layui-bg-orange">{$fees.agent}</span> 元
                    平台收入总金额：<span class="layui-badge layui-bg-red">{$fees.platform}</span> 元
                </blockquote>
            </div>
            <table id="app-order-list" lay-filter="app-order-list"></table>
            <script type="text/html" id="buttonTpl">
                {{#  if(d.status == '2'){ }}
                <button class="layui-btn layui-btn-normal layui-btn-xs">完成</button>
                {{#  } else if(d.status == '1'){ }}
                <button class="layui-btn layui-btn-primary layui-btn-xs">等待</button>
                {{#  } else{ }}
                <button class="layui-btn layui-btn-danger layui-btn-xs">关闭</button>
                {{#  } }}
            </script>
            <script type="text/html" id="table-system-order">
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="details"><i class="layui-icon layui-icon-edit"></i>详情</a>
            </script>
        </div>
    </div>
</div>

<script src="__ADMIN__/layui/layui.js"></script>
<script>
    layui.config({
        base: '__ADMIN__/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'orders','laydate', 'table'], function(){
        var $ = layui.$
            ,form = layui.form
            ,laydate = layui.laydate
            ,table = layui.table;


        //同时绑定多个日期
        lay('.app-laydate-item').each(function(){
            laydate.render({
                elem: this
                ,value: new Date()
                ,trigger: 'click'
            });
        });

        //监听搜索
        form.on('submit(app-order-list-search)', function(data){
            var field = data.field;

            //执行重载
            table.reload('app-order-list', {
                where: field
            });
        });
    });
</script>
</body>
</html>